package org.vectrics.common.view;


/**
 * @author Mike Moore
 * @version 1.0
 */

import org.apache.log4j.Category;
import org.vectrics.domain.Domain;

public class Menu extends MenuItem {
    private static Category log = Category.getInstance(Menu.class);
    private MenuItem selectItem = null;
    private String code = null;
    private String description = null;


    // override of MenuItem method.
    public Menu getMenu() {
        return(this);
    }
    
    public MenuItem getSelectedItem() {
        return(selectItem);
    }
    
    public  void setSelectedItem(MenuItem item) {
            selectItem = item;
    }
 
    public void setSelectItem(String itemId) {
        MenuItem item = findItemWithId(itemId);
        if (item == null)
            if (itemId.trim().length() > 0)
                log.error("selectItem() - could not find item with ID = " + itemId);
            else
                log.debug("selectItem() - could not find item with ID = " + itemId);
        else {
            setSelectedItem(item);
        }
    }

	/**
	 * @return Returns the code.
	 */
	public String getCode() {
		return code;
	}

	/**
	 * @param code The code to set.
	 */
	public void setCode(String code) {
		this.code = code;
	}

	/**
	 * @return Returns the description.
	 */
	public String getDescription() {
		return description;
	}

	/**
	 * @param description The description to set.
	 */
	public void setDescription(String description) {
		this.description = description;
	}


}